import org.grails.plugins.springsecurity.service.AuthenticateService

abstract class SecureController
{
    AuthenticateService authenticateService

    def beforeInterceptor = {
        if (!session.user) {
            session.user = authenticateService.userDomain()
        } 
        if(session.user && !session.user.isAttached()){
            session.user.attach()
        }
    }
} 
